/*
 * (#)LocalFactory.java 1.0 Apr 2, 2009  
 */
package com.sms.plateform.common.util;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * @author ryan
 */
public class LockFactory {
	private static Map<String, ReadWriteLock> lockPool = new LinkedHashMap<String, ReadWriteLock>();
	public static ReadWriteLock getReadWriteLock(String username) {
		if (!lockPool.containsKey(username)) {
			lockPool.put(username, new ReentrantReadWriteLock());
		}
		return lockPool.get(username);
	}
}
